```
=======================================================================
WELCOME TO REGULAR EXPRESSIONS WITH PYTHON'S RE MODULE
=======================================================================

Hello, and welcome to your first lesson on using Regular Expressions with Python's `re` module! Today, you'll learn the basics of pattern matching, and how to apply them in your Python scripts.

To follow along, please open a terminal or command prompt and type `ipython` to start the interactive Python shell. Don't worry if you haven't used it before. It's just like the regular Python interpreter but with some extra features for interactive exploration.

=======================================================================
INTRODUCTION TO REGULAR EXPRESSIONS
=======================================================================

Regular expressions (regex) are patterns used to match character combinations in strings. Using the `re` module in Python, you can search for patterns, extract data, and more!

Let's start by importing the `re` module. To do this, type:

```python
import re
```

=======================================================================
CONCEPT 1: SIMPLE MATCHING WITH re.search()
=======================================================================

The `re.search()` function scans a string for any location where the regex pattern produces a match. It returns a match object if successful, or `None` if the pattern is not found.

**Example:** Let's detect if the letter 'a' is present in a string.

```python
match = re.search('a', 'cat')
```

`match` will be a match object since 'a' is present in 'cat'.

Try it out with:

```python
re.search('a', 'dog')
```

Can you guess the output of the above code?

=======================================================================
EXERCISE 1:
=======================================================================

Modify the pattern to search for 'o' in the string 'dog'. Run it in your Python shell.

```python
# Your code here
```

**Expected Outcome:** You're looking for 'o' in 'dog'. What does the match object tell you?

=======================================================================
CONCEPT 2: WILDCARDS WITH THE DOT CHARACTER
=======================================================================

Dots (.) in regex match any character except a newline. It's a wildcard for single character matching.

**Example:** Let's match any character followed by 'at'. 

```python
match = re.search('.at', 'cat')
```

Try it out in your ipython shell and see what you get.

=======================================================================
EXERCISE 2:
=======================================================================

Use `re.search()` and the dot wildcard to find patterns ending with 'at' in the following strings: 'bat', 'hat', 'matter'.

```python
# Your code here
```

**Expected Outcome:** Test each string. Which string doesn't fit our simple `.at` pattern?

=======================================================================
CONCEPT 3: USING CHARACTER SETS
=======================================================================

Character sets let you specify a set of possible characters you're willing to match. They're defined by square brackets [].

**Example:** Match 'c', 'b', or 'm' followed by 'at'.

```python
match = re.search('[cbm]at', 'cat')
```

Try matching the above pattern with different strings like 'bat' and 'mat'.

=======================================================================
EXERCISE 3:
=======================================================================

Modify the character set to include 'h' so it matches 'hat'.

```python
# Your code here
```

**Expected Outcome:** Ensure 'hat' is successfully matched with your new pattern.

=======================================================================
CONCEPT 4: REPEATED CHARACTERS WITH '+'
=======================================================================

The plus symbol (+) matches one or more occurrences of the preceding element.

**Example:** Let's match one or more 'a's in a string.

```python
match = re.search('a+', 'baaarn')
```

Now try it with:

```python
# Determine the number of consecutive 'a's matched
```

=======================================================================
EXERCISE 4:
=======================================================================

Find multiple 'o's in a word like 'moon' using the pattern 'o+'.

```python
# Your code here
```

**Expected Outcome:** Check how many 'o's match in 'moon'.

=======================================================================
CHALLENGE:
=======================================================================

Create a pattern that matches three consecutive vowels (a, e, i, o, u) in the string 'beautician'.

```python
# Your code here
```

**Success Criteria:** Your regex should find 'eau' in 'beautician'.

=======================================================================
FURTHER EXPLORATION:
=======================================================================

- Explore more on patterns like '^' for line start and '$' for line end.
- Try using re.findall() to extract multiple matches.
- Practice creating more complex patterns with different quantifiers (?, *, etc.)
- Dive deeper into capturing groups for more structured data extraction.

Keep experimenting and having fun! Regex might seem daunting at first, but with practice, you'll become proficient. Kudos for making it through Lesson 1!

=======================================================================

```